//using System;
//using System.Reflection;
//using System.Collections;
//using System.Collections.Generic;
//using System.Text;
//using System.ServiceModel;
//using System.Runtime.Serialization;
//using System.Xml;
//using System.ServiceModel.Channels;
//using System.Diagnostics;
//using System.IO;
//using System.Xml.Schema;
//using System.ServiceModel.Description;
//using Microsoft.MSE.Catalog.Contracts;
//using Microsoft.MSE.Catalog.Contracts.Messages;
//using Microsoft.MSE.Catalog.Contracts.Services;
//using MSEContracts = Microsoft.MSE.Catalog.Contracts;
//using Microsoft.MSE.Catalog.Module;

//namespace Microsoft.MSE.Catalog.Services
//{
//    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, AddressFilterMode = AddressFilterMode.Any)]
//    public class WCFCatalogSvc : IServiceModel, IChangeNotificationService
//    {
//        private ISubscriptionManager _subscriptionManager;
//        private INotificationManager _notificationManager;
//        private object _eventingLock = new object();

//        public WCFCatalogSvc(Uri baseAddress)
//        {
//        }

//        private ISubscriptionManager Subscriptions
//        {
//            get
//            {
//                if (_subscriptionManager != null)
//                    return _subscriptionManager;
//                lock (_eventingLock)
//                {
//                    if (_subscriptionManager != null)
//                        return _subscriptionManager;
//                    //try to obtain reference registered as an Extension before defaulting to our own implmenetation
//                    _subscriptionManager = OperationContext.Current.Host.Extensions.Find<ISubscriptionManager>();
//                    if (_subscriptionManager == null)
//                        _subscriptionManager = new SubscriptionManager();
//                    return _subscriptionManager;
//                }
//            }
//        }
//        private INotificationManager Notifications
//        {
//            get
//            {
//                if (_notificationManager != null)
//                    return _notificationManager;
//                lock (_eventingLock)
//                {
//                    if (_notificationManager != null)
//                        return _notificationManager;
//                    //try to obtain reference registered as an Extension before defaulting to our own implmenetation
//                    _notificationManager = OperationContext.Current.Host.Extensions.Find<INotificationManager>();
//                    if (_notificationManager == null)
//                    {
//                        //_notificationManager = new NotificationManager(this.Subscriptions);
//                        //new notification manager that doesn't use subscription list
//                        _notificationManager = new MSENotificationManager();
//                    }
//                    return _notificationManager;
//                }
//            }
//        }

//        #region Private Members
//        private static MseEventData BuildNotificationData(DBEventContext dbNotification)
//        {
//            MseEventData mseEvent = new MseEventData(MapDbEventToEventTopics(dbNotification.Event, dbNotification.ChangeType));
//            //fill out notification details;

//            foreach (DBEventDataItem dbItem in dbNotification.EventData)
//            {
//                //Process RuntimeServer event data
//                RuntimeServerEventData rsItem = mseEvent.RuntimeServers.Find(data => data.Id == dbItem.RuntimeServerId.ToString());

//                if (rsItem == null)
//                {
//                    rsItem = new RuntimeServerEventData();
//                    rsItem.Id = dbItem.RuntimeServerId.ToString();
//                    mseEvent.RuntimeServers.Add(rsItem);
//                }

//                //Process Endpoint event data
//                //move on to next dbItem if no endpoint id
//                if (dbItem.EndpointId == Guid.Empty)
//                    continue;
//                EndpointEventData epItem = rsItem.Endpoints.Find(data => data.Id == dbItem.EndpointId.ToString());

//                if (epItem == null)
//                {
//                    epItem = new EndpointEventData();
//                    epItem.Id = dbItem.EndpointId.ToString();
//                    rsItem.Endpoints.Add(epItem);
//                }

//                //Process Operation event data
//                //move on to next dbItem if no operation id
//                if (dbItem.OperationId == Guid.Empty)
//                    continue;
//                OperationEventData opItem = epItem.Operations.Find(data => data.Id == dbItem.OperationId.ToString());
//                if (opItem == null)
//                {
//                    opItem = new OperationEventData();
//                    opItem.Id = dbItem.OperationId.ToString();
//                    epItem.Operations.Add(opItem);
//                }
//            }
//            return mseEvent;
//        }
//        private static EventTopics MapDbEventToEventTopics(DBEvents item, DBChangeType changeType)
//        {
//            switch (item)
//            {
//                case DBEvents.RuntimeServersUpdated:
//                    return EventTopics.RuntimeUpdated;
//                case DBEvents.EndpointsUpdated:
//                    switch (changeType)
//                    {
//                        case DBChangeType.Create:
//                            return EventTopics.RuntimeEndpointAdded;
//                        case DBChangeType.Delete:
//                            return EventTopics.RuntimeEndpointRemoved;
//                        default:
//                            return EventTopics.RuntimeEndpointChanged;
//                    }
//                case DBEvents.OperationsUpdated:
//                    return EventTopics.RuntimeEndpointOperationChanged;
//                case DBEvents.EndpointOpAssociationUpdated:
//                    switch (changeType)
//                    {
//                        case DBChangeType.Delete:
//                            return EventTopics.RuntimeEndpointOperationDeActivated;
//                        default:
//                            return EventTopics.RuntimeEndpointOperationChanged;
//                    }
//                case DBEvents.EndpointOpPublicationUpdated:
//                    switch (changeType)
//                    {
//                        case DBChangeType.Create:
//                            return EventTopics.RuntimeEndpointOperationPublished;
//                        case DBChangeType.Delete:
//                            return EventTopics.RuntimeEndpointOperationUnPublished;
//                        default:
//                            return EventTopics.RuntimeEndpointOperationChanged;
//                    }
//                case DBEvents.RuntimeServersBindingUpdated:
//                    return EventTopics.RuntimeBindingUpdated;
//                default:
//                    return EventTopics.RuntimeUpdated;
//            }
//        }
//        #endregion

//        #region MSEEventing Members

//        public void AcceptEvent(AcceptEventMsg request)
//        {
//            if (request == null || request.AcceptEvent == null)
//            {
//                TraceHelper.TraceError("Invalid event notification received from DB.");
//                return;
//            }

//            TraceHelper.TraceInformation("Event Notification for " + request.AcceptEvent.Event.ToString() + " received from DB");
//            switch (request.AcceptEvent.Event)
//            {  
//                case DBEvents.EndpointOpAssociationUpdated:
//                case DBEvents.EndpointOpPublicationUpdated:
//                case DBEvents.EndpointsUpdated:
//                    try
//                    {
//                        MseEventData notificationData = BuildNotificationData(request.AcceptEvent);
//                        Notifications.RaiseEvent(notificationData);
//                        Dictionary<Guid, Guid> endpoints = new Dictionary<Guid, Guid>();
//                        foreach (DBEventDataItem dbEventDataItem in request.AcceptEvent.EventData)
//                        {
//                            if (dbEventDataItem.EndpointId != Guid.Empty &&
//                                endpoints.ContainsKey(dbEventDataItem.EndpointId) == false)
//                            {
//                                // This is disabled for now
//                                //DAL.PublishEndPointToUddi(dbEventDataItem.EndpointId, false, null, null);
//                                endpoints.Add(dbEventDataItem.EndpointId, dbEventDataItem.EndpointId);
//                            }
//                        }
//                    }
//                    catch (Exception ex)
//                    {
//                        string msg = ex.Message;
//                        throw ex;
//                    }
//                    break;
//                case DBEvents.OperationsUpdated:
//                    try
//                    {
//                        MseEventData notificationData = BuildNotificationData(request.AcceptEvent);
//                        Notifications.RaiseEvent(notificationData);
//                    }
//                    catch (Exception ex)
//                    {
//                        string msg = ex.Message;
//                        throw ex;
//                    }
//                    break;
//                case DBEvents.RuntimeServersUpdated:
//                case DBEvents.RuntimeServersBindingUpdated:
//                    try
//                    {
//                        MseEventData notificationData = BuildNotificationData(request.AcceptEvent);
//                        Notifications.RaiseEvent(notificationData);
//                        Dictionary<Guid, Guid> runtimeservers = new Dictionary<Guid, Guid>();
//                        foreach (DBEventDataItem dbEventDataItem in request.AcceptEvent.EventData)
//                        {
//                            if (dbEventDataItem.RuntimeServerId != Guid.Empty &&
//                                runtimeservers.ContainsKey(dbEventDataItem.RuntimeServerId) == false)
//                            {
//                                DAL.PublishRuntimeServerEndPointsToUddi(dbEventDataItem.RuntimeServerId, false, null, null);
//                                runtimeservers.Add(dbEventDataItem.RuntimeServerId, dbEventDataItem.RuntimeServerId);
//                            }
//                        }
//                    }
//                    catch (Exception ex)
//                    {
//                        string msg = ex.Message;
//                        throw ex;
//                    }
//                    break;
//                //case DBEvents.EndpointPolicyUpdated:
//                //    sSubscriptionManager.RaiseEvent(Enum.GetName(request.AcceptEvent.Event.GetType(), request.AcceptEvent.Event));
//                //    break;
//                //case DBEvents.ServiceDefinitionUpdated:
//                //    sSubscriptionManager.RaiseEvent(Enum.GetName(request.AcceptEvent.Event.GetType(), request.AcceptEvent.Event));
//                //    break;
//                //case DBEvents.ServicePolicyUpdated:
//                //    sSubscriptionManager.RaiseEvent(Enum.GetName(request.AcceptEvent.Event.GetType(), request.AcceptEvent.Event));
//                //    break;
//                default:
//                    throw new ApplicationException("Unknown Event Received [" + Enum.GetName(typeof(DBEvents), request.AcceptEvent.Event) + "]");
//            }
//        }

//        //public SubscribeResponseMsg Subscribe(SubscribeRequestMsg request)
//        //{
//        //    return new SubscribeResponseMsg(Subscriptions.Subscribe(request.Subscribe));
//        //}

//        //public RenewResponseMsg Renew(RenewRequestMsg request)
//        //{
//        //    if (request.ReferenceParameters == null) throw new WSEInvalidMessageFault(SC.CatalogSvcActor, "ReferenceParameters Header was not supplied");
//        //    return new RenewResponseMsg(Subscriptions.Renew(request.Renew, request.ReferenceParameters));
//        //}

//        //public void Unsubscribe(UnsubscribeRequestMsg request)
//        //{
//        //    if (request.ReferenceParameters == null) throw new WSEInvalidMessageFault(SC.CatalogSvcActor, "ReferenceParameters Header was not supplied");
//        //    Subscriptions.Unsubscribe(request.Unsubscribe, request.ReferenceParameters);
//        //}

//        //public GetStatusResponseMsg GetStatus(GetStatusRequestMsg request)
//        //{
//        //    if (request.ReferenceParameters == null) throw new WSEInvalidMessageFault(SC.CatalogSvcActor, "ReferenceParameters Header was not supplied");
//        //    return new GetStatusResponseMsg(Subscriptions.GetStatus(request.GetStatus, request.ReferenceParameters));
//        //}

//        #endregion


//        #region IWCFCatalogSvc Members

//        public Guid GetIDFromName(string entityName, EntityClass entityClass)
//        {
//            try
//            {
//                return DAL.GetIDFromName(entityName, entityClass, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
        
//        public RuntimeServerList ListRuntimeServers() {
//            try {
//                return DAL.ListRuntimeServers(null, null);
//            } catch (ApplicationException aex) {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            } catch (Exception ex) {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateRuntimeServer(RuntimeServer runtimeServer) {
//            try {
//                return DAL.CreateRuntimeServer(runtimeServer, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateSchema(Schema schema)
//        {
//            try
//            {
//                return DAL.CreateSchema(schema, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteRuntimeServer(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteRuntimeServer(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServer UpdateRuntimeServer(RuntimeServer runtimeServer)
//        {
//            try
//            {
//                return DAL.UpdateRuntimeServer(runtimeServer, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServer GetRuntimeServer(Guid ID) {
//            try {
//                return DAL.GetRuntimeServer(ID,true, null, null);
//            } catch (ApplicationException aex) {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServer GetRuntimeServerWithoutEndpointWSDL(Guid ID)
//        {
//            try
//            {
//                return DAL.GetRuntimeServer(ID,false, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Schema GetSchema(Guid ID)
//        {
//            try {
//                return DAL.GetSchema(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServer GetRuntimeServerByName(string name)
//        {
//            try
//            {
//                Guid ID = DAL.GetIDFromName(name, EntityClass.RuntimeServer, null, null);
//                return DAL.GetRuntimeServer(ID,true, null, null);
//            } catch (ApplicationException aex) {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EndpointList ListEndpoints()
//        {
//            try
//            {
//                return DAL.ListEndpoints(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EndpointList ListEndpointsForRuntimeServer(string runtimeServerName)
//        {
//            try
//            {
//                Guid runtimeServerID = DAL.GetIDFromName(runtimeServerName, EntityClass.RuntimeServer, null, null);
//                return DAL.ListEndpointsForRuntimeServerID(runtimeServerID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateEndpoint(Endpoint endpoint)
//        {
//            try
//            {
//                return DAL.CreateEndpoint(endpoint, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteEndpoint(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEndpoint(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Endpoint UpdateEndpoint(Endpoint endpoint)
//        {
//            try
//            {
//                return DAL.UpdateEndpoint(endpoint, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }        

//        public Endpoint GetEndpoint(Guid ID, Guid runtimeServerID)
//        {
//            try
//            {
//                return DAL.GetEndpoint(ID, runtimeServerID, true, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public Endpoint GetEndpointWithoutWSDL(Guid ID)
//        {
//            try
//            {
//                return DAL.GetEndpoint(ID, Guid.Empty, false, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Endpoint GetEndpoint(string name)
//        {
//            try {
//                Guid ID = DAL.GetIDFromName(name, EntityClass.RuntimeServer, null, null);
//                return DAL.GetEndpoint(ID,Guid.Empty,true, null, null);
//            } catch (ApplicationException aex) {
//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SchemaList ListSchemas()
//        {
//            try
//            {
//                return DAL.ListSchemas(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public List<Guid> ImportSchemas(List<Schema> importedSchemas)
//        {
//            try
//            {
//                return DAL.ImportSchemas(importedSchemas,null,null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
//        public Schema UpdateSchema(Schema schema)
//        {
//            try
//            {
//                Schema oldSchema = DAL.GetSchema(schema.ID, null, null);
//                List<string> errors = CompareSchemas(oldSchema, schema);

//                if (errors.Count > 0)
//                {
//                    string errMsg = "";
//                    foreach (string msg in errors)
//                    {
//                        errMsg += "  " + msg + ";";
//                    }
//                    throw new ApplicationException("Can not update Schema: ");
//                }

//                return DAL.UpdateSchema(schema, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        private List<string> CompareSchemas(Schema oldSchemaObj, Schema newSchemaObj)
//        { //string oldSchemaXML, string newSchemaXML) {
//            try
//            {
//                List<string> result = new List<string>();
//                XmlSchema oldSchema = XmlSchema.Read(new StringReader(oldSchemaObj.XSD.OuterXml), null);
//                XmlSchema newSchema = XmlSchema.Read(new StringReader(newSchemaObj.XSD.OuterXml), null);

//                // This is not necessary as both of these schemas have already been validated
//                //XmlSchemaSet oldSchemaSet = new XmlSchemaSet();
//                //XmlSchemaSet newSchemaSet = new XmlSchemaSet();
//                //oldSchemaSet.Add(oldSchema);
//                //newSchemaSet.Add(newSchema);
//                //try {
//                //    oldSchemaSet.Compile();
//                //} catch (XmlSchemaException ex) {
//                //    result.Add("Old schema is not valid: " + ex.Message);
//                //    return result;
//                //}
//                //try {
//                //    newSchemaSet.Compile();
//                //} catch (XmlSchemaException ex) {
//                //    result.Add("New schema is not valid: " + ex.Message);
//                //    return result;
//                //}

//                XmlSchemaObjectTable oldElementTable = oldSchema.Elements;
//                XmlSchemaObjectTable newElementTable = newSchema.Elements;

//                foreach (XmlQualifiedName name in oldElementTable.Names)
//                {
//                    if (ElementInUse(oldSchemaObj.ID, name.Name))
//                    {
//                        XmlSchemaElement oldElement = (XmlSchemaElement)oldElementTable[name];
//                        if (newElementTable.Contains(name))
//                        {
//                            XmlSchemaElement newElement = (XmlSchemaElement)newElementTable[name];
//                            if (!oldElement.SchemaTypeName.Equals(newElement.SchemaTypeName))
//                            {
//                                result.Add(name.Name + " is of different type in new Schema");
//                            }
//                        }
//                        else
//                        {
//                            result.Add(name.Name + " is missing from new Schema");
//                        }
//                    }
//                }

//                return result;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }



//        private bool ElementInUse(Guid ID, string element)
//        {
//            try
//            {
//                bool result = false;
//                OperationList operationList = DAL.ListOperationsByElement(ID, element, null, null);

//                if ((operationList.Operations != null) && (operationList.Operations.Count > 0)) result = true;
//                return result;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

        
//        #region NZ Code Added for Schema Compare / Import

        
//        public Guid ImportSchema(XmlElement schema, string preferredPrefix)
//        {
//            try
//            {

//                Schema newSchema;
//                Schema oldSchema;
//                XmlDocument xdoc = new XmlDocument();
//                xdoc.LoadXml(schema.OuterXml);
//                // NZ Code Added
//                ClearImportNodeLocation(xdoc);
//                XmlNamespaceManager xmlns = new XmlNamespaceManager(xdoc.NameTable);
//                xmlns.AddNamespace("xs", XmlSchema.Namespace);
//                string namespaceURI = xdoc.SelectSingleNode("/xs:schema/@targetNamespace", xmlns).Value;
//                Guid id = DAL.GetIDFromName(namespaceURI, EntityClass.Schema, null, null);

//                if (!id.Equals(Guid.Empty))
//                {
//                    oldSchema = DAL.GetSchema(id, null, null);
//                    XmlDocument xdoc2 = new XmlDocument();
//                    xdoc2.LoadXml(oldSchema.XSD.OuterXml);

//                    //xdoc = MergeSchemas(xdoc, xdoc2);
//                    xdoc = MergeSchemaTypes(xdoc, xdoc2);

//                    newSchema = new Schema();
//                    newSchema.ID = id;
//                    newSchema.NamespaceURI = namespaceURI;
//                    newSchema.XSD = xdoc.DocumentElement;
//                    //newSchema.PreferredPrefix = preferredPrefix;
//                    return DAL.UpdateSchema(newSchema, null, null).ID;

//                    //oldSchema = DAL.GetSchema(id, null, null);
//                    //newSchema = new Schema();
//                    //newSchema.NamespaceURI = namespaceURI;
//                    //newSchema.XSD = schema;
//                    //newSchema.Description = oldSchema.Description;
//                    //if (!string.IsNullOrEmpty(preferredPrefix)) {
//                    //    newSchema.PreferredPrefix = preferredPrefix;
//                    //} else {
//                    //    newSchema.PreferredPrefix = oldSchema.PreferredPrefix;
//                    //    newSchema.ID = oldSchema.ID;
//                    //}
//                    //List<string> errors = CompareSchemas(oldSchema, newSchema);
//                    //if (errors.Count > 0) {
//                    //    string errMsg = "";
//                    //    foreach (string msg in errors) {
//                    //        errMsg += "  " + msg + ";";
//                    //    }
//                    //    throw new ApplicationException("Can not update Schema: ");
//                    //} else {
//                    //    DAL.UpdateSchema(newSchema, null, null);
//                    //    return newSchema.ID;
//                    //}
//                }
//                else
//                {
//                    newSchema = new Schema();
//                    newSchema.NamespaceURI = namespaceURI;
//                    newSchema.XSD = xdoc.DocumentElement;
//                    //newSchema.PreferredPrefix = preferredPrefix;
//                    return DAL.CreateSchema(newSchema, null, null);
//                }
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
        
//        private void ClearImportNodeLocation(XmlDocument schemaDoc)
//        {
//            XmlNamespaceManager xmlns = new XmlNamespaceManager(schemaDoc.NameTable);
//            xmlns.AddNamespace("xsd", XmlSchema.Namespace);
//            XmlNodeList importNodes = schemaDoc.SelectNodes("//xsd:import", xmlns);
//            foreach (XmlNode xn in importNodes)
//            {
//                if (xn.Attributes["schemaLocation"] != null)
//                {
//                    xn.Attributes.Remove(xn.Attributes["schemaLocation"]);
//                }
//            }
//            string xml = schemaDoc.OuterXml;
//        }
//        private XmlDocument MergeSchemaTypes(XmlDocument schema1, XmlDocument schema2)
//        {
//            XmlSchema xs1 = null;
//            XmlSchema xs2 = null;
//            XmlSchemaSet xss1 = LoadSchemaFromXml(schema1, out xs1);
//            XmlSchemaSet xss2 = LoadSchemaFromXml(schema2, out xs2);


//            foreach (XmlQualifiedName xqn in xs2.AttributeGroups.Names)
//            {
//                if (xs1.AttributeGroups.Contains(xqn) == false)
//                {
//                    xs1.Items.Add(xs2.AttributeGroups[xqn]);
//                }
//                else
//                {
//                    WriteWarningForMatchingTypes(xqn, xs1.AttributeGroups[xqn], xs2.AttributeGroups[xqn]);
//                }
//            }
//            foreach (XmlQualifiedName xqn in xs2.Attributes.Names)
//            {
//                if (xs1.Attributes.Contains(xqn) == false)
//                {
//                    xs1.Items.Add(xs2.Attributes[xqn]);
//                }
//                else
//                {
//                    WriteWarningForMatchingTypes(xqn, xs1.Attributes[xqn], xs2.Attributes[xqn]);
//                }
//            }
//            foreach (XmlQualifiedName xqn in xs2.SchemaTypes.Names)
//            {
//                if (xs1.SchemaTypes.Contains(xqn) == false)
//                {
//                    xs1.Items.Add(xs2.SchemaTypes[xqn]);
//                }
//                else
//                {
//                    WriteWarningForMatchingTypes(xqn, xs1.SchemaTypes[xqn], xs2.SchemaTypes[xqn]);
//                }
//            }
//            foreach (XmlQualifiedName xqn in xs2.Elements.Names)
//            {
//                if (xs1.Elements.Contains(xqn) == false)
//                {
//                    xs1.Items.Add(xs2.Elements[xqn]);
//                }
//                else
//                {
//                    WriteWarningForMatchingTypes(xqn, xs1.Elements[xqn], xs2.Elements[xqn]);
//                }
//            }
//            string schemaXml = ConvertSchemaToXml(xs1);
//            XmlDocument xdoc = new XmlDocument();
//            xdoc.LoadXml(schemaXml);
//            MergerSchemaImports(xdoc, schema2);

//            return xdoc;
//        }
//        private void MergerSchemaImports(XmlDocument schemaDoc1, XmlDocument schemaDoc2)
//        {
//            XmlNamespaceManager xmlns = new XmlNamespaceManager(schemaDoc2.NameTable);
//            xmlns.AddNamespace("xsd", XmlSchema.Namespace);
//            XmlNodeList importNodes = schemaDoc2.SelectNodes("//xsd:import", xmlns);
//            foreach (XmlNode xn in importNodes)
//            {
//                if (xn.Attributes != null && string.IsNullOrEmpty(xn.Attributes["namespace"].Value) == false)
//                {
//                    XmlElement xe = xn as XmlElement;
//                    XmlElement xeImport = schemaDoc1.CreateElement(xe.Prefix, xe.LocalName, xe.NamespaceURI);
//                    XmlAttribute xaNamespace = xeImport.Attributes.Append(schemaDoc1.CreateAttribute("namespace"));
//                    xaNamespace.Value = xn.Attributes["namespace"].Value;
//                    DAL.AppendImportElementToSchema(schemaDoc1, xeImport);
//                }
//            }
//        }
//        private void WriteWarningForMatchingTypes(XmlQualifiedName xqn, XmlSchemaObject xso1, XmlSchemaObject xso2)
//        {
//            //string typeXml1 = SerializeSchemaO(xso1, xqn.Namespace);
//            //string typeXml2 = SerializeSchemaElement(xso2, xqn.Namespace);
//            //if (typeXml1.Equals(typeXml2))
//            //{
//            //    TraceHelper.TraceInformation("Ingoring second definition of type [{0}:{1}] as it is a duplicate of the first",xqn.Namespace,xqn.Name);
//            //}
//            //else
//            //{
//            //    TraceHelper.TraceWarning("Ingoring second definition of [{0}:{1}], however it may be defined differently: old definition [{2}] - new definition [{3}]", xqn.Namespace, xqn.Name,typeXml1,typeXml2);
//            //}

//        }
//        private XmlSchemaSet LoadSchemaFromXml(XmlDocument schemaDoc, out XmlSchema xs)
//        {
//            XmlSchemaSet xss = new XmlSchemaSet();
//            StringBuilder sbErrors = new StringBuilder();
//            Dictionary<string,string> importHash = new Dictionary<string,string>();

//            sbErrors.Append("");
//            ValidationEventHandler vh = new ValidationEventHandler
//            (
//                delegate(object ob, ValidationEventArgs args)
//                {
//                    try
//                    {
//                        sbErrors.AppendFormat("Schema Validation Error: Exception[{0}] Message[{1}]", TraceHelper.GetExceptionDetails(args.Exception), args.Message);
//                    }
//                    catch (Exception ex)
//                    {
//                        sbErrors.AppendFormat("Failed to Validate Schema due to error [{0}]", TraceHelper.GetExceptionDetails(ex));
//                    }
//                }
//            );

//            xs = XmlSchema.Read(new StringReader(schemaDoc.OuterXml), vh);
//            if (sbErrors.ToString().Length > 0)
//            {
//                xs = null;
//                throw new ApplicationException(string.Format("Invalid schema XML [{0}] Error while loading [{1}]", schemaDoc.OuterXml, sbErrors.ToString()));
//            }
//            xss.Add(xs);
//            importHash.Add(xs.TargetNamespace,xs.TargetNamespace);
//            DAL.LoadImportedSchemas(xss, importHash, schemaDoc, null, null);
//            xss.Compile();
//            return xss;
//        }

//        private string ConvertSchemaToXml(XmlSchema schema)
//        {
//            StringBuilder sb = new StringBuilder();
//            XmlWriter xw = XmlWriter.Create(sb);
//            schema.Write(xw);
//            xw.Flush();
//            return sb.ToString();
//        }
//        #endregion

//        private XmlDocument MergeSchemas(XmlDocument schema1, XmlDocument schema2)
//        {
//            XmlNamespaceManager xmlns = new XmlNamespaceManager(schema1.NameTable);
//            xmlns.AddNamespace("xsd", XmlSchema.Namespace);

//            foreach (XmlNode node in schema2.SelectNodes("/xsd:schema/child::*", xmlns))
//            {
//                bool skip = false;
//                foreach (XmlNode node2 in schema1.SelectNodes("/xsd:schema/xsd:" + node.LocalName, xmlns))
//                {
//                    string name1 = null;
//                    string name2 = null;
//                    if (node.Attributes["name"] != null) name1 = node.Attributes["name"].Value;
//                    if (node2.Attributes["name"] != null) name2 = node2.Attributes["name"].Value;
//                    if ((!string.IsNullOrEmpty(name1)) && (!string.IsNullOrEmpty(name2)) && (name1.Equals(name2)))
//                    { // same "element", is it different
//                        skip = true;
//                        if (node.InnerXml.Equals(node2.InnerXml))
//                        {
//                            TraceHelper.TraceInformation("Ingoring second definition of " + node.Name + " " + name1 + " as it is a duplicate of the first");
//                        }
//                        else
//                        {
//                            string oldDef = node.InnerXml;
//                            string newDef = node2.InnerXml;
//                            TraceHelper.TraceWarning("Ingoring second definition of " + node.Name + " " + name1 + ", however it may be defined differently: old definition [{0}] - new definition [{1}]", oldDef, newDef);
//                        }
//                    }
//                }
//                if (!skip)
//                {
//                    XmlElement xl = node as XmlElement;
//                    if (xl != null)
//                    {
//                        XmlNode nxl = schema1.CreateElement(xl.Prefix, xl.LocalName, xl.NamespaceURI);
//                        foreach (XmlAttribute xattr in xl.Attributes)
//                        {
//                            XmlAttribute nxattr = schema1.CreateAttribute(xattr.Prefix, xattr.LocalName, xattr.NamespaceURI);
//                            nxattr.Value = xattr.Value;
//                            nxl.Attributes.Append(nxattr);
//                        }
//                        nxl.InnerXml = xl.InnerXml;
//                        if (string.Compare(nxl.LocalName, "import", false) == 0 &&
//                            string.Compare(nxl.NamespaceURI, XmlSchema.Namespace, true) == 0)
//                        {
//                            // It is import node so it should be at the very beginning
//                            DAL.AppendImportElementToSchema(schema1, nxl);
//                        }
//                        else
//                        {
//                            schema1.SelectSingleNode("/xsd:schema", xmlns).AppendChild(nxl);
//                        }
//                    }
//                }
//            }

//            return schema1;
//        }

//        public void DeleteSchema(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteSchema(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
        
//        public OperationList ListOperations()
//        {
//            try
//            {
//                return DAL.ListOperations(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

       
//        public OperationList ListOperationsBySchema(Guid ID)
//        {
//            try
//            {
//                return DAL.ListOperationsBySchema(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateOperation(Operation operation)
//        {
//            try
//            {
//                return DAL.CreateOperation(operation, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteOperation(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteOperation(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Operation UpdateOperation(Operation operation)
//        {
//            try
//            {
//                return DAL.UpdateOperation(operation, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Operation GetOperation(Guid ID)
//        {
//            try
//            {
//                return DAL.GetOperation(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateOperationVersion(OperationVersion operationVersion)
//        {
//            try
//            {
//                return DAL.CreateOperationVersion(operationVersion, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteOperationVersion(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteOperationVersion(ID, null, null, true);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationVersion UpdateOperationVersion(OperationVersion operationVersion)
//        {
//            try
//            {
//                return DAL.UpdateOperationVersion(operationVersion, null, null, true);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationVersion GetOperationVersion(Guid ID)
//        {
//            try
//            {
//                return DAL.GetOperationVersion(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void AssignAssociatedOperationVerToEndpoint(Guid operationVersionID, Guid endpointID)
//        {
//            try
//            {
//                DAL.AssignAssociatedOperationVersionToEndpoint(operationVersionID, endpointID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void AssignPublishedOperationVerToEndpoint(Guid operationVersionID, Guid endpointID)
//        {
//            try
//            {
//                DAL.AssignPublishedOperationVersionToEndpoint(operationVersionID, endpointID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void RemoveAssociatedOperationVerForEndpoint(Guid operationVersionID, Guid endpointID)
//        {
//            try
//            {
//                DAL.RemoveAssociatedOperationVersionFromEndpoint(operationVersionID, endpointID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void RemovePublishedOperationVerForEndpoint(Guid operationVersionID, Guid endpointID)
//        {
//            try
//            {
//                DAL.RemovePublishedOperationVersionFromEndpoint(operationVersionID, endpointID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ChannelList ListChannels()
//        {
//            try
//            {
//                return DAL.ListChannels(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateChannel(Channel channel)
//        {
//            try
//            {
//                return DAL.CreateChannel(channel, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteChannel(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteChannel(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Channel UpdateChannel(Channel chnl)
//        {
//            try
//            {
//                return DAL.UpdateChannel(chnl, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Channel GetChannel(Guid ID)
//        {
//            try
//            {
//                return DAL.GetChannel(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public PolicyList ListPolicies()
//        {
//            try
//            {
//                return DAL.ListPolicies(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreatePolicy(Policy policy)
//        {
//            try
//            {
//                return DAL.CreatePolicy(policy, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeletePolicy(Guid ID)
//        {
//            try
//            {
//                DAL.DeletePolicy(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Policy UpdatePolicy(Policy policy)
//        {
//            try
//            {
//                return DAL.UpdatePolicy(policy, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Policy GetPolicy(Guid ID)
//        {
//            try
//            {
//                return DAL.GetPolicy(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEBindingList ListMSEBindings()
//        {
//            try
//            {
//                return DAL.ListMSEBindings(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Guid CreateMSEBinding(MSEBinding binding)
//        {
//            try
//            {
//                return DAL.CreateMSEBinding(binding, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteMSEBinding(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteMSEBinding(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEBinding UpdateMSEBinding(MSEBinding binding)
//        {
//            try
//            {
//                return DAL.UpdateMSEBinding(binding, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEBinding GetMSEBinding(Guid ID)
//        {
//            try
//            {
//                return DAL.GetMSEBinding(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
    
//        public List<OperationVersion> GetOperationVersionsForEndpointAndAction(Guid endpointID, string action)
//        {
//            try
//            {
//                return DAL.GetOperationVersionsForEndpointAndAction(endpointID, action, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<OperationVersion> GetOperationVersionsForEndpointAndFirstBodyElement(Guid endpointID, string elementName, string namespaceURI)
//        {
//            try
//            {
//                return DAL.GetOperationVersionsForEndpointAndFirstBodyElement(endpointID, elementName, namespaceURI, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Boolean ValidateOperationVersionRequest(XmlElement request, Guid opVersionID)
//        {
//            try
//            {
//                return DAL.ValidateOperationVersionRequest(request, opVersionID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationGroup CreateOperationGroup(OperationGroup operationGroup)
//        {
//            try
//            {
//                return DAL.CreateOperationGroup(operationGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationGroup GetOperationGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetOperationGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteOperationGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationGroup UpdateOperationGroup(OperationGroup operationGroup)
//        {
//            try
//            {
//                return DAL.UpdateOperationGroup(operationGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListEntityGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(4,null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListEntityGroupsByOperation(Guid operationID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(operationID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationGroupList ListOperationGroups()
//        {
//            try
//            {
//                return DAL.ListOperationGroups(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public OperationGroupList ListOperationGroupsByOperation(Guid operationID)
//        {
//            try
//            {
//                return DAL.ListOperationGroupsByOperation(operationID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<OperationListElement> ListOperationsByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListOperationsByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }



//        public EndpointGroup CreateEndpointGroup(EndpointGroup endpointGroup)
//        {
//            try
//            {
//                return DAL.CreateEndpointGroup(endpointGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EndpointGroup GetEndpointGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetEndpointGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteEndpointGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EndpointGroup UpdateEndpointGroup(EndpointGroup endpointGroup)
//        {
//            try
//            {
//                return DAL.UpdateEndpointGroup(endpointGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListEndpointGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(2, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListEndpointGroupsByEndpoint(Guid endpointID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(endpointID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<EndpointListElement> ListEndpointsByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListEndpointsByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public SchemaGroup CreateSchemaGroup(SchemaGroup schemaGroup)
//        {
//            try
//            {
//                return DAL.CreateSchemaGroup(schemaGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SchemaGroup GetSchemaGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetSchemaGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteSchemaGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SchemaGroup UpdateSchemaGroup(SchemaGroup schemaGroup)
//        {
//            try
//            {
//                return DAL.UpdateSchemaGroup(schemaGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListSchemaGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(9, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListSchemaGroupsBySchema(Guid schemaID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(schemaID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<SchemaListElement> ListSchemasByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListSchemasByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public RuntimeServerGroup CreateRuntimeServerGroup(RuntimeServerGroup runtimeServerGroup)
//        {
//            try
//            {
//                return DAL.CreateRuntimeServerGroup(runtimeServerGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServerGroup GetRuntimeServerGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetRuntimeServerGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteRuntimeServerGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public RuntimeServerGroup UpdateRuntimeServerGroup(RuntimeServerGroup runtimeServerGroup)
//        {
//            try
//            {
//                return DAL.UpdateRuntimeServerGroup(runtimeServerGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListRuntimeServerGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(0, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListRuntimeServerGroupsByRuntimeServer(Guid runtimeServerID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(runtimeServerID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<RuntimeServerListElement> ListRuntimeServersByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListRuntimeServersByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public ChannelGroup CreateChannelGroup(ChannelGroup channelGroup)
//        {
//            try
//            {
//                return DAL.CreateChannelGroup(channelGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ChannelGroup GetChannelGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetChannelGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteChannelGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ChannelGroup UpdateChannelGroup(ChannelGroup channelGroup)
//        {
//            try
//            {
//                return DAL.UpdateChannelGroup(channelGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListChannelGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(7, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListChannelGroupsByChannel(Guid channelID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(channelID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<ChannelListElement> ListChannelsByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListChannelsByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public MSEBindingGroup CreateMSEBindingGroup(MSEBindingGroup mseBindingGroup)
//        {
//            try
//            {
//                return DAL.CreateMSEBindingGroup(mseBindingGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEBindingGroup GetMSEBindingGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetMSEBindingGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteMSEBindingGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEBindingGroup UpdateMSEBindingGroup(MSEBindingGroup mseBindingGroup)
//        {
//            try
//            {
//                return DAL.UpdateMSEBindingGroup(mseBindingGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListMSEBindingGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(6, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListMSEBindingGroupsByMSEBinding(Guid mseBindingID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(mseBindingID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<MSEBindingListElement> ListMSEBindingsByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListMSEBindingsByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        public PolicyGroup CreatePolicyGroup(PolicyGroup policyGroup)
//        {
//            try
//            {
//                return DAL.CreatePolicyGroup(policyGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public PolicyGroup GetPolicyGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetPolicyGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeletePolicyGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public PolicyGroup UpdatePolicyGroup(PolicyGroup policyGroup)
//        {
//            try
//            {
//                return DAL.UpdatePolicyGroup(policyGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListPolicyGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(8, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListPolicyGroupsByPolicy(Guid policyID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(policyID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<PolicyListElement> ListPolicysByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListPoliciesByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        //System 
//        public Guid CreateSystem(MSEContracts.System system)
//        {
//            try
//            {
//                return DAL.CreateSystem(system, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteSystem(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteSystem(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEContracts.System UpdateSystem(MSEContracts.System system)
//        {
//            try
//            {
//                return DAL.UpdateSystem(system, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public MSEContracts.System GetSystem(Guid ID)
//        {
//            try
//            {
//                return DAL.GetSystem(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SystemList ListSystems()
//        {
//            try
//            {
//                return DAL.ListSystems(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<SystemListElement> ListSystemsByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListSystemsByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SystemGroup CreateSystemGroup(SystemGroup systemGroup)
//        {
//            try
//            {
//                return DAL.CreateSystemGroup(systemGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SystemGroup GetSystemGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetSystemGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteSystemGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public SystemGroup UpdateSystemGroup(SystemGroup systemGroup)
//        {
//            try
//            {
//                return DAL.UpdateSystemGroup(systemGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListSystemGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(12, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListSystemGroupsBySystem(Guid systemID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(systemID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }


//        //Resource

//        public Guid CreateResource(Resource resource)
//        {
//            try
//            {
//                return DAL.CreateResource(resource, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteResource(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteResource(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Resource UpdateResource(Resource resource)
//        {
//            try
//            {
//                return DAL.UpdateResource(resource, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public Resource GetResource(Guid ID)
//        {
//            try
//            {
//                return DAL.GetResource(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ResourceList ListResources()
//        {
//            try
//            {
//                return DAL.ListResources(null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public List<ResourceListElement> ListResourcesByGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.ListResourcesByGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ResourceGroup CreateResourceGroup(ResourceGroup resourceGroup)
//        {
//            try
//            {
//                return DAL.CreateResourceGroup(resourceGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ResourceGroup GetResourceGroup(Guid ID)
//        {
//            try
//            {
//                return DAL.GetResourceGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void DeleteResourceGroup(Guid ID)
//        {
//            try
//            {
//                DAL.DeleteEntityGroup(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ResourceGroup UpdateResourceGroup(ResourceGroup resourceGroup)
//        {
//            try
//            {
//                return DAL.UpdateResourceGroup(resourceGroup, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListResourceGroups()
//        {
//            try
//            {
//                return DAL.ListEntityGroups(14, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public EntityGroupList ListResourceGroupsByResource(Guid resourceID)
//        {
//            try
//            {
//                return DAL.ListEntityGroupsByEntity(resourceID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void PublishRuntimeServerEndPointsToUddi(Guid ID, bool refresh)
//        {
//            try
//            {
//                DAL.PublishRuntimeServerEndPointsToUddi(ID, refresh, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));
                
//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public void RemoveRuntimeServerEndPointsFromUddi(Guid ID)
//        {
//            try
//            {
//                DAL.RemoveRuntimeServerEndPointsFromUddi(ID, null, null);
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public bool IsUddiIntegrationEnabled()
//        {
//            try
//            {
//                if (Configurator.svcConfig.serviceCatalogUddi != null &&
//                    Configurator.svcConfig.serviceCatalogUddi.UddiIntegrationMode == true)
//                    return true;
//                else
//                    return false;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
//        #endregion

//        public GetIDFromNameResponse GetIDFromName(GetIDFromNameRequest request)
//        {
//            try
//            {
//                GetIDFromNameResponse response = new GetIDFromNameResponse();
//                response.ID = DAL.GetIDFromName(request.EntityName, request.EntityClass, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public GetOperationResponse GetOperation(GetOperationRequest request)
//        {
//            try
//            {
//                GetOperationResponse response = new GetOperationResponse();
//                response.Operation = DAL.GetOperation(request.ID, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public GetOperationVersionsForEndpointAndActionResponse GetOperationVersionsForEndpointAndAction(GetOperationVersionsForEndpointAndActionRequest request)
//        {
//            try
//            {
//                GetOperationVersionsForEndpointAndActionResponse response = new GetOperationVersionsForEndpointAndActionResponse();
//                response.OperationVersions = DAL.GetOperationVersionsForEndpointAndAction(request.EndpointID, request.Action, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public GetOperationVersionsForEndpointAndFirstBodyElementResponse GetOperationVersionsForEndpointAndFirstBodyElement(GetOperationVersionsForEndpointAndFirstBodyElementRequest request)
//        {
//            throw new System.NotImplementedException();
//        }

//        public GetPolicyResponse GetPolicy(GetPolicyRequest request)
//        {
//            try
//            {
//                GetPolicyResponse response = new GetPolicyResponse();
//                response.Policy = DAL.GetPolicy(request.ID, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public GetRuntimeServerByNameResponse GetRuntimeServerByName(GetRuntimeServerByNameRequest request)
//        {
//            try
//            {
//                GetRuntimeServerByNameResponse response = new GetRuntimeServerByNameResponse();
//                Guid runtimeServerID = DAL.GetIDFromName(request.Name, EntityClass.RuntimeServer, null, null);
//                response.RuntimeServer = DAL.GetRuntimeServer(runtimeServerID,true, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }

//        public ValidateOperationVersionRequestResponse ValidateOperationVersionRequest(ValidateOperationVersionRequestRequest request)
//        {
//            try
//            {
//                ValidateOperationVersionRequestResponse response = new ValidateOperationVersionRequestResponse();
//                response.IsValid = DAL.ValidateOperationVersionRequest(request.Request, request.OperationVersionID, null, null);
//                return response;
//            }
//            catch (ApplicationException aex)
//            {
//                TraceHelper.TraceError("An application error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(aex));

//                string subFaultCode = SC.DefaultSubFaultCode;

//                if (aex.Data.Contains(SC.SubFaultCodeKey)) subFaultCode = aex.Data[SC.SubFaultCodeKey] as string;
//                throw new FaultException(aex.Message, FaultCode.CreateReceiverFaultCode(new FaultCode(subFaultCode, MseConstants.MSENamespace)));
//            }
//            catch (Exception ex)
//            {
//                TraceHelper.TraceError("An unexpected error occurred in Catalog Service Operation [{0}]. Error Detail [{1}]", MethodInfo.GetCurrentMethod().Name, DAL.GetExceptionDetails(ex));

//                throw new FaultException(ex.Message, FaultCode.CreateSenderFaultCode(new FaultCode(SC.UnknownSubFaultCode, MseConstants.MSENamespace)));
//            }
//        }
//    }
//}